home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Online / AmigaTalk / intuition / BoopsiClassNames.st < prev    next >
Text File  |  2002-03-15  |  2KB  |  62 lines

  1. " ------------------------------------------------------------------- "
  2. " BoopsiClassNames Class is a Singleton class that allows the user to "
  3. " reference BOOPSI Class name Strings as Symbols.                     "
  4. ""
  5. " The User does NOT need to create one of these, since Intuition      "
  6. " Class will instantiate the only needed instance of this Class.  See "
  7. " the SetupIntuition.st source file for the method(s) that help the   "
  8. " User with this Class.                                               "
  9. ""
  10. "  EXAMPLE:  'myTag <- intuition getBoopsiClassName: #IMAGECLASS'     "
  11. ""
  12. " ALL singleton classes MUST contain the following:                   "
  13. ""
  14. "   the methods:  isSingleton AND privateSetup     AND                "
  15. "                 uniqueInstance Class instance variable.             "
  16. " ------------------------------------------------------------------- "
  17.  
  18. Class BoopsiClassNames :Dictionary ! uniqueInstance !
  19. [
  20.    isSingleton
  21.      ^ true  
  22. |  
  23.    privateNew ! newInstance !
  24.      newInstance <- super new.
  25.      ^ newInstance
  26. |
  27.    new
  28.      ^ (self privateSetup)
  29. |
  30.    privateSetup
  31.      (uniqueInstance isNil)
  32.        ifTrue: [uniqueInstance  <- self privateNew.
  33.  
  34.                 self privateSetupDictionary.
  35.                ].
  36.                
  37.      ^ self
  38. |
  39.    privateSetupDictionary     
  40.  
  41.      " Class id strings for Intuition classes.  There's no real 
  42.      * reason to use the uppercase constants over the lowercase 
  43.      * strings, but this makes a good place to list the names of
  44.      * the built-in (BOOPSI) classes:
  45.      "
  46.      self at: #ROOTCLASS     put: 'rootclass'.     " classusr.h      "
  47.      self at: #IMAGECLASS    put: 'imageclass'.    " imageclass.h "
  48.      self at: #FRAMEICLASS   put: 'frameiclass'.
  49.      self at: #SYSICLASS     put: 'sysiclass'.
  50.      self at: #FILLRECTCLASS put: 'fillrectclass'.
  51.      self at: #GADGETCLASS   put: 'gadgetclass'.   " gadgetclass.h "
  52.      self at: #PROPGCLASS    put: 'propgclass'.
  53.      self at: #STRGCLASS     put: 'strgclass'.
  54.      self at: #BUTTONGCLASS  put: 'buttongclass'.
  55.      self at: #FRBUTTONCLASS put: 'frbuttonclass'.
  56.      self at: #GROUPGCLASS   put: 'groupgclass'.
  57.      self at: #ICCLASS       put: 'icclass'.       " icclass.h "
  58.      self at: #MODELCLASS    put: 'modelclass'.
  59.      self at: #ITEXTICLASS   put: 'itexticlass'.
  60.      self at: #POINTERCLASS  put: 'pointerclass'.  " pointerclass.h "
  61. ]
  62.